<template>
	
	<view >
		
		
		<view  v-for="item in MyEmployeeInfo" v-if="item.postName === '设计主管' || item.postName === '销售人员' ">
	<!-- //悬浮窗 -->
		
			<liu-drag-button @clickBtn="openPopup1('bottom')"  ><image src="../../../../static/jeesite/add.png" style="height: 38rpx;width:38rpx;" ></image></liu-drag-button>
		
	  	</view>
		<view class="addnext"  v-for="item in jsonData" :key="item.orderId" :class="{addnexted:getShowAddnext(item.orderId)}" >
	
			
		</view>	
			  	
		
			
		
		<!-- 详情弹出层 -->
		<view v-if="this.isGONGYINGSHANG">	
		<view class="pop" v-for="item in jsonData" :key="item.orderId" :class="{poped:getShowFlag(item.orderId)} ">
			<w-popup  v-model="isshow3" ref="el" :z-index="2" :height="1300"  >
			 
				<view class="btn2"   @click=" showTag(item.orderId)" ><image src="https://www.dingzhai.com.cn/js/a/product/file/download?fileName=e91fcb67-b211-4fb2-82ba-942512bee391.png" style="width: 30rpx ;height: 30rpx;"></image></view>
				<ir-tabs :navs="navs" :multiple="true" >
				        <template v-slot:page1 style="padding: 20px;">
			
			
			
			<view style="display: flex; background-color: #fff; border-radius: 30rpx;margin: 8rpx;">
				
				<view style="margin-top:30rpx ;">
					<view class="title2">订单管理员：{{item.orderManager}}</view>
					<view class="title2">下单时间：{{item.createTime}}</view>
					<view style="display: flex;justify-content: center; ">
						<view class="title2" style="font-size: 29rpx;">订单状态：{{item.orderStatus}}</view>
						<view class="title2" style="font-size: 29rpx;">是否延期：{{item.delayed}}</view>
					</view>
				</view>
			</view>
			<view class="title2" style="background-color: #fff; border-radius: 30rpx;margin: 8rpx;" >
				<view style="justify-content: center;text-align: center; margin-top: 20rpx; ">
					<view style="background-color: #f1f1f6;width: 160rpx;border-radius: 50%; margin-left: 280rpx;" >
						<image src="../../../../static/jeesite/customer.png" style="width: 150rpx;height: 150rpx;"></image>
					</view>
					<view style="margin-left:-10rpx ;">
					   <input  style="width: fit-content; font-size: 80rpx;" class="detailcontent" :class="{editinput:!getEditOrder(item.orderId)}" placeholder="请输入客户姓名" :name="item.clientName" v-model="item.clientName" :disabled="getEditOrder(item.orderId)">
					</view>
				</view>
				<view >
				
					<view class="title2" style="display: flex; ">联系电话：<input style="width: fit-content;" class="detailcontent" :class="{editinput:!getEditOrder(item.orderId)}"  :name="item.phone" v-model="item.phone" :disabled="getEditOrder(item.orderId)"></view>
					<view class="title2"  style="display: flex; ">已缴订金金额：<input style="width: fit-content;" class="detailcontent" :class="{editinput:!getEditOrder(item.orderId)}"  :name="item.reserveAmount" v-model="item.reserveAmount" :disabled="getEditOrder(item.orderId)"></view>
					<view class="title2"  style="display: flex;">预估金额：<input style="width: fit-content;" class="detailcontent" :class="{editinput:!getEditOrder(item.orderId)}"  :name="item.estimatedAmount" v-model="item.estimatedAmount" :disabled="getEditOrder(item.orderId)"></view>
					<view class="title2"  style="display: flex;">合同金额：<input style="width: fit-content;" class="detailcontent" :class="{editinput:!getEditOrder(item.orderId)}"  :name="item.amount" v-model="item.amount" :disabled="getEditOrder(item.orderId)"></view>
					<view class="title2"  style="display: flex; ">是否有售后：<input style="width: fit-content;" class="detailcontent" :class="{editinput:!getEditOrder(item.orderId)}"   :name="item.afterSales" v-model="item.afterSales" :disabled="getEditOrder(item.orderId)"></view>
					<view class="title2"  style="display: flex;">售后补单编号：<input style="width: fit-content;" class="detailcontent" :class="{editinput:!getEditOrder(item.orderId)}"   :name="item.afterSalesOrder" v-model="item.afterSalesOrder" :disabled="getEditOrder(item.orderId)"></view>
					<view class="title2">
						地址:
						<view style="width: 450rpx;">
						<textarea  maxlength="250" @input="riseInput" style="" class="detailcontent" :class="{editinput:!getEditOrder(item.orderId)}"   :name="item.address" v-model="item.address" :disabled="getEditOrder(item.orderId)"></textarea> 
						</view>
					</view>
					<view class="title2">备注<span>(最多输入250字)</span>:
						<view style="width: 450rpx;">
						<textarea maxlength="250" @input="riseInput" style="" class="detailcontent" :class="{editinput:!getEditOrder(item.orderId)}"   :name="item.comment" v-model="item.comment" :disabled="getEditOrder(item.orderId)"></textarea> 
						</view>
					
					</view>
				</view>
			</view>
			
			
			
			
			
			
			
			 </template>
			 
			 <template v-slot:page2>
			         <scroll-view scroll-y="true" style="margin-left: 0px;">
						 
						 
						 
						
						 <cc-defineStep :colors="colors" :stepData="agoarr"   ></cc-defineStep>
						
						 
						
						
					 </scroll-view>
								
					 	      
					 	    
					 
			     </template>
				
			 </ir-tabs>
			 
		
			 
			</w-popup>
			
			
			
			</view>
			
			
		</view>	
			
			
			
			
			
		<!-- 供应商详情弹出层 -->
		<view v-if="!this.isGONGYINGSHANG">	
		<view class="pop" v-for="item in jsonData" :key="item.orderId" :class="{poped:getShowFlag(item.orderId)} ">
			<w-popup  v-model="isshow3" ref="el" :z-index="2" :height="500"  >
			 
				<view class="btn2"   @click=" showTags(item.orderId)" ><image src="https://www.dingzhai.com.cn/js/a/product/file/download?fileName=e91fcb67-b211-4fb2-82ba-942512bee391.png" style="width: 30rpx ;height: 30rpx;"></image></view>
				
			 <view class="item-container" v-for="item in GYSagoarr">
				<view class="title2" style="display: flex; ">订单id：<input style="width: 560rpx;" class="detailcontent"  v-model="item.orderId" ></view>
				<view class="title2" style="display: flex; ">当前订单状态：<input style="width: fit-content;" class="detailcontent"  v-model="item.orderStatus" ></view>
				<view class="title2" style="display: flex; ">开始时间：<input style="width: fit-content;" class="detailcontent"  v-model="item.sendingTime" ></view>
				<view class="title2" style="display: flex; ">预计完成时间：<input style="width: fit-content;" class="detailcontent"  v-model="item.expectFinishTime" ></view>
				<view class="title2" style="display: flex; ">是否延期：<input style="width: fit-content;" class="detailcontent"  v-model="item.delayed" ></view>
				<view class="title2">备注:
					<view style="width: 450rpx;">
					<textarea maxlength="250" @input="riseInput" style="" class="detailcontent" :class="{editinput:!getEditOrder(item.orderId)}"   :name="item.comment" v-model="item.comment" :disabled="getEditOrder(item.orderId)"></textarea> 
					</view>
				</view>
				
			 </view>
		
			 
			</w-popup>
			
			
			
			</view>
			
			
		</view>	
			
			
			<zero-custom-bar backgroundColor="rgba(241, 241, 246, 1.0)">
			        <view class="lefticon" slot='left' >
			            <button   border="0px" width="10rpx" @click="showDrawer" ><uni-icons type="bars"></uni-icons></button>
			        </view>
			        <view class="" >
			            <h3>部门订单：{{jsonData.length}}个</h3>
			        </view>
					
			        </zero-custom-bar>
			
			<genos-drawer  ref="showleft" mode="left" :mask-click="true" statusBar="true">
					
					<view style="margin-top: 200rpx;">
					<navigator url="/pages/order/myOrder/index/index"><view class="list-item" ><button >待处理订单</button></view></navigator>
					<navigator url="/pages/order/finishorder/index/finishorder"><view class="list-item" ><button >已完成订单</button></view></navigator>
					<navigator url="/pages/order/departmentorder/index/departmentorder" ><view class="list-item"><button>部门订单</button></view></navigator>
					<view v-for="item in MyEmployeeInfo">
					<navigator url="/pages/order/myManengeOrder/index/myManengeOrder" v-if="item.postCode === 'Order_manager'"><view class="list-item"><button>我管理的订单</button></view></navigator>
					</view>
				    <navigator url="/pages/sys/user/index" open-type="switchTab"><view class="list-item"><button>个人中心</button></view></navigator>
					</view>
					
					<!-- <button class="closebutton" @click="closeDrawer" type="primary" style="background-color: #db311b;"><image src="../../../../static/jeesite/退出.png" style="width: 20px;  height: 20px;"></image></button> -->
			</genos-drawer>
			
			
			
			
			
			
			<!-- 非供应商 -->
			<view class="fadeleftIn" v-if="this.isGONGYINGSHANG">
				
				<view class="out" style="margin-top: 5rpx;"> 
					
				<view    v-for="item in jsonData" :key="item.orderId"    >
				
				<uni-swipe-action>
					<uni-swipe-action-item
						
					>
						
						<template v-slot:left>
								
								
								
							</template>
				
					
							<view class="row"  @click = "showTag(item.orderId)" >
							
							
							<!-- <view class="btn2" ><image  @click="deleteDate(item)" style="width: 30px;height: 30px;" src="../../static/jeesite/垃圾桶.png"></image></view>
								
								<view class="btn2" ><button style="background-color: #1951be; color: #f8f8f8;" @click = "show3=true" >详情</button></view> -->
							<view class="title" style="padding-left: 10px; font-size: 40rpx; font-weight: 500;">{{item.clientName}}</view>
							
							
							<view class="title1"  style="padding-left: 10px;"><view style="width: 100%;color: #f5b502;" >订单状态：{{item.orderStatus}}</view><view class="amount" style="width: auto; color:orangered; padding-right: 5px;" >订金：</view><input style="width: auto; color:orangered; padding-right: 5px;"   v-model="item.reserveAmount" disabled="true"/></view>
							<view class="title"  style="padding-left: 10px;">是否延期：{{item.delayed}}</view>
							<view class="title" style="display: flex; align-items: center; "><view style="width: 100%; padding-left: 10px;">订单管理员：{{item.orderManager}}</view> 
							
							
							
							</view>
							
							</view>
							
							<!-- <view class="btn1" :class="{editorder:!getEditOrder(item.orderId)}"><button  @click="editOrder(item.orderId)"><image src="../../static/jeesite/编辑文件.png" style="width: 30px;height: 30px;"></image>编辑订单</button></view>
							<view class="btn1" ><button   @click="updateDate(item)"  :class="{editorder:getEditOrder(item.orderId)}"><image src="../../static/jeesite/保存.png" style="width: 30px;height: 30px;"></image>保存订单</button></view> -->
							<template v-slot:right>
									
									
									
								</template>
								
								</uni-swipe-action-item>
							</uni-swipe-action>	
				
				</view>
				
					
			</view>
				
			</view>
			
			<!-- 供应商 -->
			<view class="fadeleftIn" v-if="!this.isGONGYINGSHANG">
				
				<view class="out" style="margin-top: 5rpx;"> 
					
				<view    v-for="item in jsonData" :key="item.orderId"    >
				
				<uni-swipe-action>
					<uni-swipe-action-item
						
					>
						
						<template v-slot:left>
								
								
								
							</template>
				
					
							<view class="row"   >
							
							
							<!-- <view class="btn2" ><image  @click="deleteDate(item)" style="width: 30px;height: 30px;" src="../../static/jeesite/垃圾桶.png"></image></view>
								
								<view class="btn2" ><button style="background-color: #1951be; color: #f8f8f8;" @click = "show3=true" >详情</button></view> -->
							<view class="title" style="padding-left: 10px; font-size: 40rpx; font-weight: 500;">{{item.clientName}}</view>
							
							
							
							<view class="title"  style="padding-left: 10px;">是否延期：{{item.delayed}}</view>
							<view class="title" style="display: flex; align-items: center; "><view style="width: 100%; padding-left: 10px;">订单管理员：{{item.orderManager}}</view> 
							
							
							
							</view>
							
							</view>
							
							<!-- <view class="btn1" :class="{editorder:!getEditOrder(item.orderId)}"><button  @click="editOrder(item.orderId)"><image src="../../static/jeesite/编辑文件.png" style="width: 30px;height: 30px;"></image>编辑订单</button></view>
							<view class="btn1" ><button   @click="updateDate(item)"  :class="{editorder:getEditOrder(item.orderId)}"><image src="../../static/jeesite/保存.png" style="width: 30px;height: 30px;"></image>保存订单</button></view> -->
							<template v-slot:right>
									
									
									
								</template>
								
								</uni-swipe-action-item>
							</uni-swipe-action>	
				
				</view>
				
					
			</view>
				
			</view>
			
			
			<liu-popup type="bottom" ref="bottom" height="1100rpx" bgColor="rgba(241, 241, 246, 1.0)">
			
			
			
			<!-- 销售人员 -->
			           <view class="container" v-for="item in MyEmployeeInfo" v-if="item.postName === '销售人员'">
			           	       
			           			   <!-- <view class="form-group">
			           				   <text>订单创建时间：</text>
			           				   <view class="example-body">
			           				   	<uni-datetime-picker type="datetime" :start="start" :end="end" v-model="datetimeString" @change="change" />
			           				   </view>
			           			   </view> -->
			           			   
			           								
			           	   	  <view class="form-group">
			           	   	    客户姓名：
			           								<uni-forms-item rules="{required: true, message: '客户姓名不能为空'}">	
			           	   	    <input 
			           style="height: 60rpx;
			           background-color: #fff;
			           border-radius: 15rpx;" type="text"  v-model='neworder.clientName'/>
			           								</uni-forms-item> 
			           	   	  </view>
			           								 
			           								
			           	   	  <view class="form-group">
			           	   	    客户电话：
			           								<uni-forms-item rules="{required: true, message: '客户电话不能为空'}">
			           	   	    <input 
			           			style="height: 60rpx;
			           background-color: #fff;
			           border-radius: 15rpx;"
			           			type="number" v-model='neworder.phone'  maxlength="11"/>
			           								</uni-forms-item>	
			           	   	  </view>
			           								
			           								
			           	   	  <view class="form-group">
			           	   	    地址：
			           								<uni-forms-item rules="{required: true, message: '地址不能为空'}">	
			           	   	    <input 
			           			style="height: 60rpx;
			           background-color: #fff;
			           border-radius: 15rpx;"
			           			type="text"  v-model='neworder.address'/>
			           								</uni-forms-item>	
			           	   	  </view>
			           								
			           								
			           	   	  <view class="form-group">
			           															  
			           	   	    合作方：
			           													<uni-forms-item rules="{required: true, message: '合作方不能为空'}">		
			           															<input
			           																		style="height: 60rpx;
			           															background-color: #fff;
			           															border-radius: 15rpx;"
			           																		type="text"  v-model='neworder.partner'/>
			           													</uni-forms-item>						
			           												
			           	   	  </view>
			           								
			           								
			           														  <view class="form-group" >
			           														  	   	    订单管理员： 
			           														  	<uni-forms-item rules="{required: true, message: '订单管理员不能为空'}">  
			           																
			           																  	<hpy-form-select style="background-color: #fff;" :dataList="orderManager" text="empName" name="empCode" v-model="neworder.orderManager" />
			           																			 
			           																			  		
			           																			  	
			           															</uni-forms-item>				  
			           														  	   	  </view>
			           								
			           								
			           																  <view class="form-group" style="display: none;">
			           																  	   	    订单状态：
			           																  	   	   
			           																  	   	   			<!-- <picker  @change="picker($event)" mode='selector' :value="arrayIndex" :range="arrayList" range-key="value" >
			           																  	   	   				<view class="picker" v-model="neworder.orderStatus">{{arrayItem.value?arrayItem.value:'对象选择器'}}</view>
			           																  	   	   			</picker> -->
			           																  	   	   			<input
			           																  	   	   			style="height: 60rpx;
			           																  	   	   			background-color: #fff;
			           																  	   	   	
			           																  	   	   			
			           																	border-radius: 15rpx; " type="text" v-model='neworder.orderType = '0'' />	  	   	  </view>
			           	         
			           	         <view class="form-group">
			           	           备注:
			           	           <input 
			           				style="height: 60rpx;
			           background-color: #fff;
			           border-radius: 15rpx;"
			           				type="text" v-model='neworder.comment'/>
			           	         </view>
			           	         <button @click="saveDate(neworder)"  style="font-size: 34rpx; font-weight: 900; border-radius: 15rpx; background-color: rgba(25, 81, 190, 1.0); color: #fff;margin-top: 20rpx;">新增自然订单</button>
			           	       
			           	     </view>
							 
							<!-- 设计主管 -->
							<view class="container" v-for="item in MyEmployeeInfo" v-if="item.postName === '设计主管'">
								       
										   <!-- <view class="form-group">
											   <text>订单创建时间：</text>
											   <view class="example-body">
											   	<uni-datetime-picker type="datetime" :start="start" :end="end" v-model="datetimeString" @change="change" />
											   </view>
										   </view> -->
										   
								         
								   	  <view class="form-group">
								   	    客户姓名：
								   	    <input 
							style="height: 60rpx;
							background-color: #fff;
							border-radius: 15rpx;" type="text"  v-model='newwayorder.clientName'/>
								   	  </view>
								   	  <view class="form-group">
								   	    客户电话：
								   	    <input  
										style="height: 60rpx;
							background-color: #fff;
							border-radius: 15rpx;"
										type="number" v-model='newwayorder.phone' maxlength="11"/>
								   	  </view>
								   	  <view class="form-group">
								   	    地址：
								   	    <input 
										style="height: 60rpx;
							background-color: #fff;
							border-radius: 15rpx;"
										type="text"  v-model='newwayorder.address'/>
								   	  </view>
								   	  <view class="form-group">
																				  
								   	    合作方：
																				
																				<input
																							style="height: 60rpx;
																				background-color: #fff;
																				border-radius: 15rpx;"
																							type="text"  v-model='newwayorder.partner'/>
																	
								   	  </view>
														  <view class="form-group">
														  	   	    设计师： 
														  	   
																 	<hpy-form-select style="background-color: #fff;" :dataList="DesignerInDepartment" text="empName" name="empCode" v-model="newwayorder.designer" />
														  	   	  </view>
																			  <view class="form-group">
																			  	   	订单管理员： 
																			  	   		<hpy-form-select style="background-color: #fff;" :dataList="orderManager" text="empName" name="empCode" v-model="newwayorder.orderManager" />
																			  	   	  </view>
																					  <view class="form-group" style="display: none;">
																					  	   	    订单状态：
																					  	   	   
																					  	   	   			<!-- <picker  @change="picker($event)" mode='selector' :value="arrayIndex" :range="arrayList" range-key="value" >
																					  	   	   				<view class="picker" v-model="neworder.orderStatus">{{arrayItem.value?arrayItem.value:'对象选择器'}}</view>
																					  	   	   			</picker> -->
																					  	   	   			<input
																					  	   	   			style="height: 60rpx;
																					  	   	   			background-color: #fff;
																					  	   	   			border-radius: 15rpx; " type="text" v-model='newwayorder.orderStatus = '4'' />
																					  	   	   			
																					  	   	  </view>
								        
								         <view class="form-group">
								           备注:
								           <input 
											style="height: 60rpx;
							background-color: #fff;
							border-radius: 15rpx;"
											type="text" v-model='newwayorder.comment'/>
								         </view>
								         <button @click="empty(newwayorder)"  style="font-size: 34rpx; font-weight: 900; border-radius: 15rpx; background-color: rgba(25, 81, 190, 1.0); color: #fff;margin-top: 20rpx;">新增渠道订单</button>
								       
								     </view>
			       </liu-popup>
							 
						
							 
							
			
			
		
			
			
		
			
					
				 
				
			
				
		
			
		</view>
		
		
		
	</template>

<script>


import config from '../../../../common/config';
	export default {
		
		data() {
			
			
			return {
				
				colors:"#248a00",
					
						 floatchat() {
						             // 步骤数组数据反序
						             this.stepData.reverse()
						         },
					ordermanageIndex: 0,
					
					historyitem:{
						orderId:""
					},
					rejectcontractItem:{
						
						orderId:"",
						orderStatus:"合同确图",
					},
					rejectauditItem:{
						orderId:"",
						orderStatus:"下单审单",
					},
					downacceptcontractItem:{
						orderId: "",
						orderStatus: "下单审单",
						nextorderStatus: 17,
						reserveAmount: "",
						comment: "",
					},
					acceptcontractItem:{
						orderId: "",
						orderStatus: "合同确图",
						nextorderStatus: 6,
						reserveAmount: "",
						comment: "",
					},
					contractconclusiveItem:{
						orderId:"",
						orderStatus: "设计师回图",
						nextorderStatus: 5,
						reserveAmount: "",
						comment: "",
					},
					designdepartmentItem:{
						officeCode:"",
						officeName:"",
					},				
					 DispatchrulerItem:{
						 orderId:"",
						 orderStatus: "订金订单",
						 nextorderStatus: 3,
						 reserveAmount:"",
						 comment:"",
						 officeCode: "",
					 },
					 DesignerbackdrawingItem:{
						orderId:"",
						orderStatus: "派单量尺",
						nextorderStatus:4,
						reserveAmount: "",
						comment: "",
						designer:"", 
						designername:"",
					 },
					neworder:{
							orderType:0,
							clientName:"",
							phone:"",
							address:"",
							partner:"",
							orderStatus:1,
							comment:"",
							orderManager:"",
					},
					newwayorder:{
							orderType:"1",
							clientName:"",
							phone:"",
							address:"",
							partner:"",
							empCode:"",
							orderStatus:4,
							reserveAmount:"",
							amount:"",
							comment:"",
							orderManager:"",
							designer:"",

					},
					depositorderitem:{
						orderStatus:"意向订单",
						comment:"",
						money:"",
						nextorderStatus:2,
						orderId:"",
						
					},
					newaddnext:{
							acceptTime:"",
							phone:"",
							address:"",
							partner:"",
							orderManager:"",
							orderStatus:"",
							reserveAmount:"",
							amount:"",
							comment:""
					},
					addshow1s:[],
					addshow1: true,
					navs: ['订单详情', '流程图'],
					 boolShow:false,
					show2:false,
					show:false,
				   jsonData:[],
				   flags: [],
				   isflag: true,
				  isDisableds: [],
				  isDisabled: true,
				  isshow3s: [],
				  isshow3: true,
				  isGONGYINGSHANG:true,
				  partnerDate:[],
				  addnextDate:[],
				  MyEmployeeInfo:[],
				 //供应商身份
				 MyEmployeeInfoRole:[],
				 orderManager:[],
				 DesignerInDepartment:[],
				 designdepartment:[],
				 dicts:[],
				 agoarr:[],
				 GYSagoarr:[],
				  content:"'您现在有'+jsonData.length+'个订单等待处理'"
				}
		},
		onReady() {},
		
		methods: {
			
			//判断是否是供应商
			istheGONGYINGSHANG(){
				 
				if (this.MyEmployeeInfoRole[0].roleName === '供应商') {
					this.isGONGYINGSHANG = !this.isGONGYINGSHANG;
				} else{
					this.isGONGYINGSHANG = true;
				}
			},
			
			ordermanagerpicker(e){
				
				
					const index = e.target.value
								this.neworder.orderManager = this.orderManager[index].empName
								this.neworder.empCode = this.orderManager[index].empCode
			},
			designerindepartmentpicker(e){
				
				
					const index = e.target.value
								this.newwayorder.designer = this.DesignerInDepartment[index].empCode
								this.newwayorder.orderManager= this.orderManager[index].empCode
								this.newwayorder.designername = this.DesignerInDepartment[index].empName
								
			},
			
			gethistory(e){
				
				this.$u.api.order.gethistory({ orderId: e }).then((res)=>{
					console.log(res)
					this.agoarr = res.list
				})
			},
			getdict(){
				this.$u.api.order.getdict({ dict: 'the_order_status' }).then((res)=>{
					console.log(res)
					this.dicts = res.list
				})
			},
			//下一步弹窗
			popupClick() {
			
				this.addshow1 = !this.addshow2;
			},
			//获取数据
			getData(){
				this.$u.api.order.listData2({
					"pageNo":1,
					"pageSize":10,
					"finishStatus":'executing'+',finish',
				}).then((res)=>{
					console.log(res)
					if (res.list.length === 0) {
						uni.showToast({
						  title: '怎么回事，你们部门咋不接单子？', 
						  icon: 'none', 
						  duration: 5000, 
						  mask: false, 
						  position: 'middle', 
						 
						});
						this.jsonData = res.list
					} else{
						this.jsonData = res.list
					}
								
								
							

				})
			},
			getMyEmployeeInfo(){
				this.$u.api.empUser.MyEmployeeInfo().then((res)=>{
					console.log(res)	
					this.MyEmployeeInfo = res.data.post;
					this.MyEmployeeInfoRole = res.data.role;
					console.log(this.MyEmployeeInfoRole[0].roleName);
					this.istheGONGYINGSHANG();
				})
				
			},
			getfindOrderManager(){
				this.$u.api.order.findOrderManager().then((res)=>{
					console.log(res)	
					this.orderManager = res.data
				})
			},
			getfindDesignerInDepartment(){
				this.$u.api.order.findDesignerInDepartment().then((res)=>{
					console.log(res)	
					this.DesignerInDepartment = res.data
				})
			},
			saveDate(e){
				if(this.neworder.clientName.trim() === ''|| this.neworder.phone.trim() === ''||this.neworder.address.trim() === '' || this.neworder.orderManager.trim() ===''||this.neworder.partner.trim() ===''){
					uni.showToast({
						title:"请检查提交内容是否有误",
						
					})
				}else{
					
						this.$u.api.order.save(e).then((res)=>{
							
							if(e.result){
								uni.showToast({
									title:"提交失败",
									
								})
							}else{
								uni.showToast({
									title:"提交成功",
								})
							}
							
							
							
							console.log(res)
							
						})
						uni.reLaunch({
							url:"/pages/order/departmentorder/index/departmentorder"
						})
					
				}
			},
			depositorder(e){
				
				this.$u.api.order.depositorder(e).then((res)=>{
					
					
					
					if(e.result){
						uni.showToast({
							title:"提交失败",
							
						})
						
					}else{
						uni.showToast({
							title:"提交成功",
						})
						
					}
					
					console.log(res)
					
				})
				uni.reLaunch({
					url:"/pages/order/departmentorder/index/departmentorder"
				})
				
			},
			deleteDate(item){
				uni.showModal({
					title: '提示',
					content: '确定删除？',
					cancelText: "取消", // 取消按钮的文字  
					confirmText: "确认", // 确认按钮的文字  
					showCancel: true, // 是否显示取消按钮，默认为 true
					confirmColor: '#f55850',
					cancelColor: '#39B54A',
					success: (res) => {
					if(res.confirm) {  
						this.$u.api.order.delete(item).then((e)=>{
							if(e.result){
								uni.showToast({
									title:"成功",
									
								})
							}else{
								uni.showToast({
									title:"失败",
								})
							}
							console.log(e)
						}),
						uni.reLaunch({
							url:"/pages/order/departmentorder/index/departmentorder"
						})
					} else {  
						console.log('cancel') //点击取消之后执行的代码
						}  
					} 
				})
				
				
			},
			
			updateDate(item){
				this.$u.api.order.update(item).then((e)=>{
					console.log(e)
					uni.reLaunch({
						url:"/pages/order/departmentorder/index/departmentorder"
					})
					
				})
			},
			
			  bindPickerChange: function(e) {
			              console.log('picker发送选择改变，携带值为', e.detail.value)
			              this.index = e.detail.value
			          },
			//获取订单详细信息
			showTag(e){
						
						
						this.$u.api.order.gethistory({ orderId: e }).then((res)=>{
							 uni.showLoading({
							    title: '正在加载中...',
							  });
							console.log(res);
							this.agoarr = res.list;
							uni.hideLoading();
						})
						
						  let flag =  this.getShowFlag(e)
						  
						  if(flag == true){
							  //
							  this.flags[e]=false;
							  
						
						  }else{
							  this.flags[e]=true;
							 
						  }
						  
						  //强制刷新
						this.$forceUpdate()
			
						  
						if(this.isflag == false){
							console.log("aaa");
							
							
						}	
							
						}, 
			
			//供应商获取订单详细信息
			showTags(e){
						
						
						this.$u.api.order.getOrderStatus({ orderId: e ,orderStatus:'工厂拆单',finishStatus:1}).then((res)=>{
							 uni.showLoading({
							    title: '正在加载中...',
							  });
							console.log(res);
							this.GYSagoarr = res.list;
							uni.hideLoading();
						})
						
						  let flag =  this.getShowFlag(e)
						  
						  if(flag == true){
							  //
							  this.flags[e]=false;
							  
						
						  }else{
							  this.flags[e]=true;
							 
						  }
						  
						  //强制刷新
						this.$forceUpdate()
			
						  
						if(this.isflag == false){
							console.log("aaa");
							
							
						}	
							
						},
			
			getEditOrder(id){
				
			console.log("id"+id)
			
			//如果没有定义，就不显示
			if(this.isDisableds[id]!=undefined&&this.isDisableds[id]==false){
				this.isDisableds[id] = false;
							
				return false;
				
			     
			}else{
				  this.isDisableds[id] = true;
				  return true;
			}

			},
			
			//详情
			getShowshow(id){
				
			console.log("id"+id)
			
			//如果没有定义，就不显示
			if(this.isshow3s[id]!=undefined&&this.isshow3s[id]==false){
				this.isshow3s[id] = false;
							
				return false;
				
			     
			}else{
				  this.isshow3s[id] = true;
				  return true;
			}
			
			},
			
			Showshow(e){
				
				let showshow3 =  this.getShowshow(e)
				  
				  if(showshow3 == false){
					  //
					  this.isshow3s[e]=true;
				
				  }else{
					  this.isshow3s[e]=false;
				  }
				  
				  //强制刷新
				this.$forceUpdate()
				
				  
				if(this.isshow3 == true){
					console.log("aaa")
				}	
				
				
				
			},
			
			//下一步
			getShowAddnext(id){
				
			console.log("id"+id)
			
			//如果没有定义，就不显示
			if(this.addshow1s[id]!=undefined&&this.addshow1s[id]==false){
				this.addshow1s[id] = false;
							
				return false;
				
			     
			}else{
				  this.addshow1s[id] = true;
				  return true;
			}
			
			},
			
			showaddnext(e){
				this.depositorderitem.orderId = e
				let showshow3 =  this.getShowAddnext(e)
				  
				  if(showshow3 == false){
					  //
					  this.addshow1s[e]=true;
				
				  }else{
					  this.addshow1s[e]=false;
				  }
				  
				  //强制刷新
				this.$forceUpdate()
				
				  
				if(this.addshow1 == true){
					console.log("aaa")
				}	
				
				
				
			},
			
			toAddOrder(){
				uni.navigateTo({
					url:"/pages/order/addmyorder/addmyorder"
				})
			},
			
			
			getShowFlag(id){
			
				console.log("id"+id)
				
				//如果没有定义，就不显示
				if(this.flags[id]!=undefined&&this.flags[id]==true){
					
                     this.flags[id] = true;
                     return true;
				}else{
					  this.flags[id] = false;
				
					return false;
				}
			},
			
			
			
			
			
			
			showDrawer() {
				this.$refs.showleft.open();
			},
			closeDrawer() {
				this.$refs.showleft.close();
			},
			
		onLoad() {
			this.getData()
			this.getdict()
			this.getMyEmployeeInfo()
			this.getfindOrderManager()
			this.getfindDesignerInDepartment()
		},
		
		 
		
		editOrder(e){
			
			let isdisabled =  this.getEditOrder(e)
			  
			  if(isdisabled == true){
				  //
				  this.isDisableds[e]=false;
			
			  }else{
				  this.isDisableds[e]=true;
			  }
			  
			  //强制刷新
			this.$forceUpdate()
			
			  
			if(this.isDisabled == false){
				console.log("aaa")
			}	
			
			
			
		},
		picker(e){
			console.log(arrayIndex);
			console.log(e);
			this.arrayItem = this.partnerDate[e.target.name];
			
		},
		getinfo(){
			  
		  },
		submitOrder() {
		  // 在这里你可以发送订单到服务器的逻辑
		  // 使用uni.request或其他适当的方法发送订单数据
		  // 处理服务器响应并提供适当的用户反馈
		},
		 openPopup1(e) {
		                this.$refs[e].open();
		            },
		openPopup2(e) {
						this.$refs[e].open();
					           },
	
			picker(e){
							this.arrayItem = this.arrayList[e.target.value];
							// 或者
							// this.arrayIndex = e.target.value;
						},
						
	
	
	empty(e){
		if(this.newwayorder.clientName.trim() === ''|| this.newwayorder.phone.trim() === ''||this.newwayorder.address.trim() === '' ||this.newwayorder.designer.trim() === ''||this.newwayorder.orderManager.trim() ===''){
			uni.showToast({
				title:"请检查提交内容是否有误",
				
			})
		}else{
			
				this.$u.api.order.save(e).then((res)=>{
					
					if(e.result){
						uni.showToast({
							title:"提交失败",
							
						})
					}else{
						uni.showToast({
							title:"提交成功",
						})
					}
					
					
					
					console.log(res)
					
				})
				
			
		}
		
		
		
		
		
		
		
		
	},
	
	
	
	
	
	},
	
	
	
	onLoad: function (options) {
			setTimeout(function () {
				console.log('start pulldown');
			}, 1000);
			uni.startPullDownRefresh();
		},
		onPullDownRefresh() {
			console.log('refresh');
			
			setTimeout(function () {
				uni.stopPullDownRefresh();
			}, 1000);
			uni.reLaunch({
				url:'/pages/order/departmentorder/index/departmentorder'
			})
		}
	
	
	
	
	
	
}
</script>

<style>
page {
		background-color: #e8e7f2;
	}
	

textarea{
		height: 100rpx;
	 width:90%;/*自己主动适应父布局宽度*/
	 overflow:auto;
	 word-break:break-all;
	 
}
span{
	color: #888;
	font-size: 3rpx;
}
	
	.closebutton{
		margin-top: 100rpx;
		text-align: center;
		bottom: 10px;
		background-color: darkred;
		
	}
	.list-item{
		text-align: center;
		
		background-color: white;
		width: 100%;
		
	}
	.list-item:focus{
		text-align: center;
		color: #3c88fa;
		background-color: white;
		width: 100%;
		
	}
	.title1{
		display: flex;
			align-items: center;
			
			font-size: 38rpx;
			font-weight: 300;
			font-style: initial;
	}
	
	.title2{
			color: #8a8a8a;
			align-items: center;
			margin-left: 15rpx;
			margin-right: 35rpx;
			font-size: 38rpx;
			font-weight: 300;
			font-style: initial;
	}
	
	.title{
		font-size: 38rpx;
		font-weight: 300;
		font-style: initial;
	}
	
.out{
	
	
	justify-content: center;
	align-items: center;
	
	
}
.out .row{
	
	width: auto;
	margin-left: 7px;
	margin-right: 7px;
	margin-bottom: 6px;
	margin-top: 10px;
	box-shadow: 2px 2px 2px rgba(0,0,0,0.5);
	border-radius: 6px;
	background-color: #fff;
	               
	border-top: rgba(255,255,255,0.5) 1px solid;
	border-left: rgba(255,255,255,0.5) 1px solid;
	backdrop-filter: blur(5px);
	height: 230rpx;
	
	white-space: nowrap;
	padding:0rpx ;
	
}

.fadeleftIn {
    -webkit-animation: fadeleftIn .4s;
    animation: fadeleftIn .4s;
}
@keyframes fadeleftIn {
    0% {
        -webkit-transform: translate3d(100%, 0, 0);
        -webkit-transform: translate3d(100%, 0, 0);
        transform: translate3d(100%, 0, 0);
        transform: translate3d(100%, 0, 0);
    }
    100% {
        -webkit-transform: none;
        transform: none;
    }
}
@-webkit-keyframes fadeleftIn {
    0% {
        -webkit-transform: translate3d(100%, 0, 0);
    }
    100% {
        -webkit-transform: none;
    }
}


.out .rowed{
	width: auto;
	
	margin: 30px;
	box-shadow: 20px 20px 50px rgba(0,0,0,0.5);
	border-radius: 15px;
	background-color: rgba(85, 170, 255, 0.6);
	               
	border-top: rgba(255,255,255,0.5) 1px solid;
	border-left: rgba(255,255,255,0.5) 1px solid;
	backdrop-filter: blur(5px);
	
	height: 220rpx;
	white-space: nowrap;
	padding:10rpx 0;
	
}


.out .row .name{
	font-zize:50rpx;
	padding-bottom: 15rpx;
	color: #333;
}
.out .row .ordertime{
	font-size: 50rpx;
	color: #888;
}


/* 初始高度，超出隐藏 */
    .dingdan-msg{
        height: 220rpx;
        overflow: hidden;
        line-height: 30rpx;
        
		
		
		width:auto;
		
		margin: 30rpx;
		box-shadow: 20rpx 20rpx 50rpx rgba(0,0,0,0.5);
		border-radius: 15rpx;
		background-color: #e8e7f2;
		               
		border-top: rgba(255,255,255,0.5) 1px solid;
		border-left: rgba(255,255,255,0.5) 1px solid;
		backdrop-filter: blur(5px);
		transition: transform 0.3s ease;
    }
/*  高度自适应，全部显示 */
    .active{
        height: auto;
        overflow: visible;
		transition: transform 0.3s ease;
    }
	.popup{
		display: none;
	}
	
	.popuped{
		display: block;
	}
	
	
	.editinput{
		
		border-radius: 10rpx;
		background-color:#ffbd27;
	}

	.btn1 {
	 background-color: #e8e7f2;
	 color: #e8e7f2;
	 margin-left: 230rpx;
	 margin-right: 230rpx;
	 cursor: pointer;
	 margin-bottom: 10rpx;
	 font-weight: 400;
	 font-size: 15rpx;
	  border-radius: 10rpx;
	 align-items: center;
	 text-align: center;
	 
	}
	
	.btn2 {
	 
	 color: #e8e7f2;
	 margin-left: 100rpx;
	 margin-right: 100rpx;
	 cursor: pointer;
	 margin-bottom: 10rpx;
	 font-weight: 400;
	 font-size: 15rpx;
	  border-radius: 10rpx;
	 align-items: center;
	 text-align: center;
	}
    
	.editorder{
		display: none;
	}

		  

	.container {
		justify-content: center;
		align-items: center;
		padding: 20px;
		background: rgba(255, 255, 255, 0.0)
	}
	
	.form {
	 
	  margin-bottom: 10px;
	}

    text{
		 color: #000;
		 font-size: 34rpx;
		 font-weight: 900;
	}
	
	
	
	.pop{
		display: none;
	}
	.poped{
		display: block;
	}
	
	.addorder{
		display: none;
	}
	.addordered{
		display: block;
	
	}
	
	.addnext{
		display: block;
	}
	
	.addnexted{
		display: none;
		
	}
	
	
	.anime-flip{ animation: flip 1.5s 1 ease-in-out; }
	
	@keyframes flip { //先转个圈圈
		0% {
			-webkit-transform: perspective(1200px) scaleX(1) translateZ(0) rotateY(-1turn);
			transform: perspective(1200px) scaleX(1) translateZ(0) rotateY(-1turn);
			-webkit-animation-timing-function: ease-out;
			animation-timing-function: ease-out;
		}
	        //再来个圈圈并加点变化
	
		40% {
			-webkit-transform: perspective(1200px) scaleX(1) translateZ(150px) rotateY(-190deg);
			transform: perspective(1200px) scaleX(1) translateZ(150px) rotateY(-190deg);
			-webkit-animation-timing-function: ease-out;
			animation-timing-function: ease-out;
		}
	
		50% {
			-webkit-transform: perspective(1200px) scaleX(1) translateZ(150px) rotateY(-170deg);
			transform: perspective(1200px) scaleX(1) translateZ(150px) rotateY(-170deg);
			-webkit-animation-timing-function: ease-in;
			animation-timing-function: ease-in;
		}
	
		80% {
			-webkit-transform: perspective(1200px) scale3d(0.95, 0.95, 0.95) translateZ(0) rotateY(0deg);
			transform: perspective(1200px) scale3d(0.95, 0.95, 0.95) translateZ(0) rotateY(0deg);
			-webkit-animation-timing-function: ease-in;
			animation-timing-function: ease-in;
		}
	
		to {
			-webkit-transform: perspective(1200px) scaleX(1) translateZ(0) rotateY(0deg);
			transform: perspective(1200px) scaleX(1) translateZ(0) rotateY(0deg);
			-webkit-animation-timing-function: ease-in;
			animation-timing-function: ease-in;
		}
	}
	
	.scroll-page-height {
		width: 750rpx;
		box-sizing: border-box;
	}
	.top_view {
		width: 750rpx;
		padding: 20rpx 32rpx;
		box-sizing: border-box;
	}
	.temp_comment {
		/* #ifndef APP-NVUE */
		display: flex;
		box-sizing: border-box;
		/* #endif */
		flex-direction: column;
		padding: 20rpx 0rpx;
	}
	.comment_title {
		/* #ifndef APP-NVUE */
		display: flex;
		box-sizing: border-box;
		/* #endif */
		flex-direction: row;
		align-items: stretch;
	}
	.avatar_content {
		/* #ifndef APP-NVUE */
		display: flex;
		box-sizing: border-box;
		/* #endif */
		flex-direction: row;
		align-items: center;
		margin-right: 16rpx;
		margin-bottom: 20rpx;
	}
	.avatar_img {
		height: 80rpx;
		width: 80rpx;
	}
	.title_wrapper {
		padding: 4rpx 0rpx;
		display: flex;
		flex-direction: column;
	}
	.user_name {
		color: #333;
		font-weight: bold;
		font-size: 28rpx;
	}
	.comment_date {
		color: #999999;
		font-size: 24rpx;
	}
	.comment_content {
		color: #666;
		font-size: 26rpx;
	}
	
	.comment_pop_stype {
		height: 810rpx;
		width: 500rpx;
		position: relative;
	}
	.comment_pop_stype_content {
		position: absolute;
		height: 800rpx;
		width: 500rpx;
		top: 0;
		left: 0;
		/* #ifndef APP-NVUE */
		display: flex;
		box-sizing: border-box;
		/* #endif */
		flex-direction: row;
		justify-content: space-between;
		background-color: #fff;
		border-radius: 20rpx;
	}
	
	.triangle {
		position: absolute;
		height: 30rpx;
		width: 30rpx;
		border-radius: 10rpx;
		background-color: #fff;
		transform: rotateZ(45deg);
		bottom: 0;
		left: 120rpx;
	}
	.pop_item_icon_s {
		height: 46rpx;
		width: 46rpx;
	}
	.pop_item_s {
		flex: 1;
		height: 800rpx;
		/* #ifndef APP-NVUE */
		display: flex;
		box-sizing: border-box;
		/* #endif */
		flex-direction: column;
		align-items: center;
		justify-content: center;
		
	}
	.pop_item_text {
		color: #999999;
		font-size: 20rpx;
		margin-top: 8rpx;
	}
</style>